<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="com.control.ResourceControl" %>
<%@ page import="com.model.Resource" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<% 
request.setCharacterEncoding("UTF-8");
String res_name=request.getParameter("name");
int res_num=Integer.parseInt(request.getParameter("number"));
String res_des=request.getParameter("describe");
int res_id=Integer.parseInt(request.getParameter("id"));
ResourceControl rc=new ResourceControl();
Resource res=new Resource();
res.setRes_id(res_id);
res.setRes_name(res_name);
res.setRes_num(res_num);
res.setRes_des(res_des);
if(rc.updateResource(res))
{
	%>
	<script>
	if(window.confirm("确认修改？"))
		window.location.href="resource_show.jsp";
	else
		window.location.href="update_resource.jsp?id=<%=res_id%>";
	</script>
	<%}else{ %>
	<script>
	alert("修改失败！");
	window.location.href="update_resource_change.jsp?id=<%=res_id%>";
	</script>
	<%} %>
}
%>
</body>
</html>